import { Redirect } from 'umi'
export default (props) => {
  const isLogin = !!sessionStorage.getItem('token')
  if (isLogin) {
    return <>{props.children}</>
  } else {
    return <Redirect to="/login" />
  }
}
